﻿<?xml version="1.0" encoding="utf-8"?>
<xsd:schema id="EussDSLSchema" targetNamespace="http://schemas.microsoft.com/dsltools/EussDSL" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/dsltools/EussDSL" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <!-- EussMapping -->
  <xsd:element name="Mapping" type="EussMapping" />
  <xsd:complexType name="EussMapping" mixed="true">
    <xsd:annotation>
      <xsd:documentation>The root of the model and the root of the mapping file.</xsd:documentation>
  	<xsd:documentation>[This class or one of its base class has custom implementation, so the content is unbounded]</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:any minOccurs="0" maxOccurs="unbounded" processContents="lax" />
    </xsd:sequence>
    <xsd:anyAttribute processContents="lax" />
  </xsd:complexType>
  
  <!-- EussMapping Moniker -->
  <xsd:element name="eussMappingMoniker" type="EussMappingMoniker" />
  <xsd:complexType name="EussMappingMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for EussMapping instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="Id" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>
  
  <!-- Entity -->
  <xsd:element name="Entity" type="Entity" />
  <xsd:complexType name="Entity" mixed="true">
    <xsd:annotation>
      <xsd:documentation>Declare the mapping for a persistent class.</xsd:documentation>
  	<xsd:documentation>[This class or one of its base class has custom implementation, so the content is unbounded]</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:any minOccurs="0" maxOccurs="unbounded" processContents="lax" />
    </xsd:sequence>
    <xsd:anyAttribute processContents="lax" />
  </xsd:complexType>
  
  <!-- Entity Moniker -->
  <!--<xsd:element name="Rule" type="Rule" />
  <xsd:complexType name="Rule">
    <xsd:annotation>
      <xsd:documentation>Moniker for Entity instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="entityChild" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>-->
  
  <!-- ModelAttribute -->
  <xsd:element name="Attribute" type="ModelAttribute" />
  <xsd:complexType name="ModelAttribute">
    <xsd:annotation>
      <xsd:documentation>Mapping of the attributes of an Entity</xsd:documentation>
    </xsd:annotation>
    <!-- Property: name -->
    <xsd:attribute name="name" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Name of the attribute to declare.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: dbtype -->
    <xsd:attribute name="db-type" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Euss database type identifier.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: defaultValue -->
    <xsd:attribute name="default-value" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>If not-null is set, contains the default value of the column.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: table -->
    <xsd:attribute name="table" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Name of the table, if the attribute must be stored in another one.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: field -->
    <xsd:attribute name="field" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>The name of the mapped database table column. The default value is the attribute’s name.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: size -->
    <xsd:attribute name="size" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Maximum length of the column.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: scale -->
    <xsd:attribute name="scale" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Numerical column resolution.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: precision -->
    <xsd:attribute name="precision" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Numerical column precision.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: notnull -->
    <xsd:attribute name="not-null" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Whether the column can’t be null.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: parentField -->
    <xsd:attribute name="parentField" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>If table is set, defines the foreign key column name containing the link with the other table.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: discriminator -->
    <xsd:attribute name="discriminator" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Discriminator</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: discriminatorValue -->
    <xsd:attribute name="discriminator-value" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Discriminator Value</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>
  
  <!-- ModelAttribute Moniker -->
  <xsd:element name="modelAttributeMoniker" abstract="true" type="ModelAttributeMoniker" />
  <xsd:complexType name="ModelAttributeMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ModelAttribute instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- Identifier -->
  <xsd:element name="Id" type="Identifier" />
  <xsd:complexType name="Identifier" mixed="true">
    <xsd:annotation>
  	<xsd:documentation>[This class or one of its base class has custom implementation, so the content is unbounded]</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:any minOccurs="0" maxOccurs="unbounded" processContents="lax" />
    </xsd:sequence>
    <xsd:anyAttribute processContents="lax" />
  </xsd:complexType>
  
  <!-- Identifier Moniker -->
  <xsd:element name="identifierMoniker" type="IdentifierMoniker" />
  <xsd:complexType name="IdentifierMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for Identifier instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="field" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>
  
  <!-- Generator -->
  <xsd:element name="Generator" type="Generator" />
  <xsd:complexType name="Generator">
    <!-- Property: name -->
    <xsd:attribute name="name" type="xsd:string" use="required" >
      <xsd:annotation>
        <xsd:documentation>Name of the strategy to use.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>
  
  <!-- Generator Moniker -->
  <xsd:element name="generatorMoniker" type="GeneratorMoniker" />
  <xsd:complexType name="GeneratorMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for Generator instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="name" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>
  
  <!-- Property -->
  <xsd:element name="Property" type="Property" />
  <xsd:complexType name="Property" mixed="true">
    <xsd:annotation>
  	<xsd:documentation>[This class or one of its base class has custom implementation, so the content is unbounded]</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:any minOccurs="0" maxOccurs="unbounded" processContents="lax" />
    </xsd:sequence>
    <xsd:anyAttribute processContents="lax" />
  </xsd:complexType>
  
  <!-- Property Moniker -->
  <xsd:element name="propertyMoniker" abstract="true" type="PropertyMoniker" />
  <xsd:complexType name="PropertyMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for Property instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- ReferenceNew -->
  <xsd:element name="Reference" type="ReferenceNew" />
  <xsd:complexType name="ReferenceNew">
    <xsd:annotation>
      <xsd:documentation>Declares the mapping for a Reference. Encapsulates Rule mapping declarations. </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Relationship: ReferenceNewHasRulesNew -->
      <xsd:choice minOccurs="0" maxOccurs="unbounded" >
        <xsd:element ref="referenceNewHasRulesNew">
          <xsd:annotation>
            <xsd:documentation>[Relationship deriving from ReferenceNewHasRulesNew needs to be serialized in full-form]</xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element ref="Rule" >
          <xsd:annotation>
            <xsd:documentation>[Target role-player]</xsd:documentation>
          </xsd:annotation>
        </xsd:element>
      </xsd:choice>
    </xsd:sequence>
    <!-- Property: name -->
    <xsd:attribute name="name" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Name of the reference to map.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: entityChild -->
    <xsd:attribute name="entityChild" type="xsd:string" use="required" >
      <xsd:annotation>
        <xsd:documentation>Full type of the entity the reference is actually linking.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: discriminatorField -->
    <xsd:attribute name="discriminator-field" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Column name containing the name of the reference in case the table handles several references.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: discriminatorValue -->
    <xsd:attribute name="discriminator-value" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Value of the column of the reference in case the table handles several references.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>
  
  <!-- ReferenceNew Moniker -->
  <xsd:element name="referenceNewMoniker" type="ReferenceNewMoniker" />
  <xsd:complexType name="ReferenceNewMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ReferenceNew instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="entityChild" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>
  
  <!-- RuleNew -->
  <xsd:element name="Rule" type="RuleNew" />
  <xsd:complexType name="RuleNew">
    <!-- Property: parentSchema -->
    <xsd:attribute name="parentSchema" type="xsd:string" />
    <!-- Property: parentTable -->
    <xsd:attribute name="parentTable" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>The table containing the parentField (if there can be an ambiguity).</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: parentField -->
    <xsd:attribute name="parentField" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>The column name to use as a foreign key in the table of the parent entity.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: parentDefaultValue -->
    <xsd:attribute name="parentDefaultValue" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Default value of the parent field.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: childSchema -->
    <xsd:attribute name="childSchema" type="xsd:string" />
    <!-- Property: childTable -->
    <xsd:attribute name="childTable" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>The table containing the childField (if there can be an ambiguity). </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: childField -->
    <xsd:attribute name="childField" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>The column name to use as a foreign key in the table of the referenced entity.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: childDefaultValue -->
    <xsd:attribute name="childDefaultValue" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Default value of the child field.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: constraint -->
    <xsd:attribute name="constraint" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Name of the constraint to create in the database.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>
  
  <!-- RuleNew Moniker -->
  <xsd:element name="ruleNewMoniker" abstract="true" type="RuleNewMoniker" />
  <xsd:complexType name="RuleNewMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for RuleNew instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- EussMappingHasElements -->
  <xsd:element name="eussMappingHasElements" abstract="true" type="EussMappingHasElements" />
  <xsd:complexType name="EussMappingHasElements" abstract="true" >
    <xsd:annotation>
      <xsd:documentation>The Entities of the mapping.</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end Entity -->
      <xsd:element ref="Entity" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- EussMappingHasElements Moniker -->
  <xsd:element name="eussMappingHasElementsMoniker" abstract="true" type="EussMappingHasElementsMoniker" />
  <xsd:complexType name="EussMappingHasElementsMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for EussMappingHasElements instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- EntityReferencesTargets -->
  <xsd:element name="ReferenceOld" type="EntityReferencesTargets" />
  <xsd:complexType name="EntityReferencesTargets" mixed="true">
    <xsd:annotation>
      <xsd:documentation>Reference relationship between two Entities.</xsd:documentation>
  	<xsd:documentation>[This class or one of its base class has custom implementation, so the content is unbounded]</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:any minOccurs="0" maxOccurs="unbounded" processContents="lax" />
    </xsd:sequence>
    <xsd:anyAttribute processContents="lax" />
  </xsd:complexType>
  
  <!-- EntityReferencesTargets Moniker -->
  <xsd:element name="entityReferencesTargetsMoniker" abstract="true" type="EntityReferencesTargetsMoniker" />
  <xsd:complexType name="EntityReferencesTargetsMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for EntityReferencesTargets instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- EntityReferencesAttributes -->
  <xsd:element name="entityReferencesAttributes" abstract="true" type="EntityReferencesAttributes" />
  <xsd:complexType name="EntityReferencesAttributes" abstract="true" >
    <xsd:annotation>
      <xsd:documentation>Attributes of an Entity (fields).</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end ModelAttribute -->
      <xsd:element ref="Attribute" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- EntityReferencesAttributes Moniker -->
  <xsd:element name="entityReferencesAttributesMoniker" abstract="true" type="EntityReferencesAttributesMoniker" />
  <xsd:complexType name="EntityReferencesAttributesMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for EntityReferencesAttributes instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- EntityHasIdentifiers -->
  <xsd:element name="entityHasIdentifiers" abstract="true" type="EntityHasIdentifiers" />
  <xsd:complexType name="EntityHasIdentifiers" abstract="true" >
    <xsd:annotation>
      <xsd:documentation>Defines the mapping for the primary key column.</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end Identifier -->
      <xsd:element ref="Id" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- EntityHasIdentifiers Moniker -->
  <xsd:element name="entityHasIdentifiersMoniker" abstract="true" type="EntityHasIdentifiersMoniker" />
  <xsd:complexType name="EntityHasIdentifiersMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for EntityHasIdentifiers instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- IdentifierHasProperties -->
  <xsd:element name="identifierHasProperties" abstract="true" type="IdentifierHasProperties" />
  <xsd:complexType name="IdentifierHasProperties" abstract="true" >
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end Property -->
      <xsd:element ref="Property" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- IdentifierHasProperties Moniker -->
  <xsd:element name="identifierHasPropertiesMoniker" abstract="true" type="IdentifierHasPropertiesMoniker" />
  <xsd:complexType name="IdentifierHasPropertiesMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for IdentifierHasProperties instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- EntityHasReferencesNew -->
  <xsd:element name="entityHasReferencesNew" abstract="true" type="EntityHasReferencesNew" />
  <xsd:complexType name="EntityHasReferencesNew" abstract="true" >
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end ReferenceNew -->
      <xsd:element ref="Reference" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- EntityHasReferencesNew Moniker -->
  <xsd:element name="entityHasReferencesNewMoniker" abstract="true" type="EntityHasReferencesNewMoniker" />
  <xsd:complexType name="EntityHasReferencesNewMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for EntityHasReferencesNew instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- ReferenceNewHasRulesNew -->
  <xsd:element name="referenceNewHasRulesNew" abstract="true" type="ReferenceNewHasRulesNew" />
  <xsd:complexType name="ReferenceNewHasRulesNew" abstract="true" >
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end RuleNew -->
      <xsd:element ref="Rule" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- ReferenceNewHasRulesNew Moniker -->
  <xsd:element name="referenceNewHasRulesNewMoniker" abstract="true" type="ReferenceNewHasRulesNewMoniker" />
  <xsd:complexType name="ReferenceNewHasRulesNewMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ReferenceNewHasRulesNew instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
</xsd:schema>

